<template>
  <div>这是详情页 - 数据请求和组合action</div>
  <ul>
    <li v-for="item in proList" :key="item.proid">{{ item.proname }}</li>
  </ul>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  // data() {
  //   return {
  //     list: [],
  //   };
  // },
  // mounted() {
  // http://121.89.205.189:3000/api/pro/list
  // },

  computed: mapState("pro", ["proList"]),
  // computed: mapState({
  //   proList: (state) => state.pro.proList,
  // }),
  // methods: mapActions(["pro/getProListAsync"]),
  methods: mapActions("pro", ["getProListAsync"]),
  mounted() {
    // 异步
    this.getProListAsync().then(() => {
      console.log(this.proList);
    });
  },
};
</script>
